#include"server.h"
int su = 0;
main()
{
	int serverfd,clientFd;
	pthread_t clientThread;
	struct sockaddr_in clientAddr;
	socklen_t len=sizeof(clientAddr);
	serverfd = openTcpSocket();
	if(serverfd<0){
		return -1;
	}
	if(sqlite3_open(PATH_DATA,&db)!=SQLITE_OK)//打开数据库
	{
			printf("%s\n",sqlite3_errmsg(db));
			return -1;
	}
	
	while(1){
	
	    clientFd = accept(serverfd,(struct sockaddr *)&clientAddr,&len);
		printf("connect success\n");
		
		pthread_create(&clientThread, NULL,recvMsg, &clientFd);
		
	}
	
}
